package com.yanqu.road.entity.activity.foxcard;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.FieldTypeAnnotation;

import java.math.BigInteger;
import java.util.*;

@FieldTypeAnnotation(tableName = "t_u_activity_fox", desc = "狐妖小红娘数据")
public class UserFoxCardData extends DataObject {
    @FieldTypeAnnotation(select = true, isIndex = true, update = true)
    private int activityId;
    @FieldTypeAnnotation(desc = "玩家id", select = true, isIndex = true, update = true)
    private long userId;
    @FieldTypeAnnotation(desc = "每日游戏次数")
    private int gameTimes;
    @FieldTypeAnnotation(desc = "最后一次游戏时间")
    private long lastGameTime;
    @FieldTypeAnnotation(desc = "体力")
    private int power;
    @FieldTypeAnnotation(desc = "体力恢复时间戳")
    private long powerRecoverTime;
    @FieldTypeAnnotation(desc = "苦情树积分")
    private int treeScore;
    @FieldTypeAnnotation(desc = "苦情树等级")
    private int treeLevel;
    @FieldTypeAnnotation(desc = "苦情树经验,目前是类抽次数")
    private int treeExp;
    @FieldTypeAnnotation(desc = "累计抽奖轮次")
    private int lotteryRound;
    @FieldTypeAnnotation(desc = "累计消耗体力")
    private int powerAmount;
    @FieldTypeAnnotation(desc = "保底前累计")
    private int guaranteeAmount;
    @FieldTypeAnnotation(desc = "是否金色保底")
    private boolean isGoldenGuarantee;
    @FieldTypeAnnotation(desc = "金色保底累计")
    private int goldenGuaranteeAmount;
    @FieldTypeAnnotation(desc = "保底的点数组合")
    private List<Integer> guaranteePoints = new ArrayList<>();
    @FieldTypeAnnotation(desc = "苦情树当前的姻缘签")
    private List<FoxTreeCard> treeCards = new ArrayList<>();
    @FieldTypeAnnotation(desc = "已解锁的卡牌")
    private Set<Integer> unlockCards = new HashSet<>();
    @FieldTypeAnnotation(desc = "已装备的卡牌")
    private List<Integer> equipCards = new ArrayList<>();
    @FieldTypeAnnotation(desc = "单次出牌最高分")
    private BigInteger maxScore = BigInteger.ZERO;
    @FieldTypeAnnotation(desc = "已通关的关卡回合,章节ID->回合数")
    private Map<Integer, Integer> passStages = new HashMap<>();
    @FieldTypeAnnotation(desc = "引导数据")
    private String guide="";

    public UserFoxCardData() {
    }

    public UserFoxCardData(int activityId, long userId) {
        this.activityId = activityId;
        this.userId = userId;
        this.treeLevel = 1;//1级开始
        setInsertOption();
    }

    public int getActivityId() {
        return activityId;
    }

    public void setActivityId(int activityId) {
        this.activityId = activityId;
    }

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        this.userId = userId;
    }

    public int getGameTimes() {
        return gameTimes;
    }

    public void setGameTimes(int gameTimes) {
        this.gameTimes = gameTimes;
        setUpdateOption();
    }

    public BigInteger getMaxScore() {
        return maxScore;
    }

    public void setMaxScore(BigInteger maxScore) {
        this.maxScore = maxScore;
        setUpdateOption();
    }

    public int getPower() {
        return power;
    }

    public void setPower(int power) {
        this.power = power;
        setUpdateOption();
    }

    public long getPowerRecoverTime() {
        return powerRecoverTime;
    }

    public void setPowerRecoverTime(long powerRecoverTime) {
        this.powerRecoverTime = powerRecoverTime;
        setUpdateOption();
    }

    public int getTreeScore() {
        return treeScore;
    }

    public void setTreeScore(int treeScore) {
        this.treeScore = treeScore;
        setTreeExp(treeScore);
        setUpdateOption();
    }

    public int getTreeLevel() {
        return treeLevel;
    }

    public void setTreeLevel(int treeLevel) {
        this.treeLevel = treeLevel;
        setUpdateOption();
    }

    public int getLotteryRound() {
        return lotteryRound;
    }

    public void setLotteryRound(int lotteryRound) {
        this.lotteryRound = lotteryRound;
        setUpdateOption();
    }

    public List<FoxTreeCard> getTreeCards() {
        return treeCards;
    }

    public void setTreeCards(List<FoxTreeCard> treeCards) {
        this.treeCards = treeCards;
        setUpdateOption();
    }

    public Set<Integer> getUnlockCards() {
        return unlockCards;
    }

    public void setUnlockCards(Set<Integer> unlockCards) {
        this.unlockCards = unlockCards;
        setUpdateOption();
    }

    public void addUnlockCards(int cardId) {
        Set<Integer> cardIds = new HashSet<>(unlockCards);
        cardIds.add(cardId);
        setUnlockCards(cardIds);
    }

    public List<Integer> getEquipCards() {
        return equipCards;
    }

    public void setEquipCards(List<Integer> equipCards) {
        this.equipCards = equipCards;
        setUpdateOption();
    }

    public long getLastGameTime() {
        return lastGameTime;
    }

    public void setLastGameTime(long lastGameTime) {
        this.lastGameTime = lastGameTime;
        setUpdateOption();
    }

    public Map<Integer, Integer> getPassStages() {
        return passStages;
    }

    public void setPassStages(Map<Integer, Integer> passStages) {
        this.passStages = passStages;
        setUpdateOption();
    }

    public int getGuaranteeAmount() {
        return guaranteeAmount;
    }

    public void setGuaranteeAmount(int guaranteeAmount) {
        this.guaranteeAmount = guaranteeAmount;
        setUpdateOption();
    }

    public List<Integer> getGuaranteePoints() {
        return guaranteePoints;
    }

    public void setGuaranteePoints(List<Integer> guaranteePoints) {
        this.guaranteePoints = guaranteePoints;
        setUpdateOption();
    }

    public int getTreeExp() {
        return treeExp;
    }

    public void setTreeExp(int treeExp) {
        this.treeExp = treeExp;
        setUpdateOption();
    }

    public String getGuide() {
        return guide;
    }

    public void setGuide(String guide) {
        this.guide = guide;
        setUpdateOption();
    }

    public boolean isGoldenGuarantee() {
        return isGoldenGuarantee;
    }

    public void setGoldenGuarantee(boolean goldenGuarantee) {
        isGoldenGuarantee = goldenGuarantee;
        setUpdateOption();
    }

    public int getPowerAmount() {
        return powerAmount;
    }

    public void setPowerAmount(int powerAmount) {
        this.powerAmount = powerAmount;
        setUpdateOption();
    }

    public int getGoldenGuaranteeAmount() {
        return goldenGuaranteeAmount;
    }

    public void setGoldenGuaranteeAmount(int goldenGuaranteeAmount) {
        this.goldenGuaranteeAmount = goldenGuaranteeAmount;
        setUpdateOption();
    }
}
